from django.db import models


# Create your models here.

class Car(models.Model):
    id = models.AutoField(primary_key=True)
    carno = models.CharField('车牌号', max_length=15)
    owner = models.CharField('车主', max_length=20)
    brand = models.CharField('品牌', max_length=20)

    class Meta:
        db_table = 'tb_car'
        verbose_name = '车辆'
        verbose_name_plural = verbose_name


class Record(models.Model):
    id = models.AutoField(primary_key=True)
    reason = models.CharField('原因', max_length=255)
    makedate = models.DateField(verbose_name='日期')
    punish = models.CharField('处理方法', max_length=255)
    dealt = models.BooleanField('是否受理', default=0)
    car = models.ForeignKey(to=Car, on_delete=models.PROTECT)


    class Meta:
        db_table = 'tb_record'
        verbose_name = '记录'
        verbose_name_plural = verbose_name
